# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=wacomtablet
pkgver=3.2.0
pkgrel=4
pkgdesc="GUI for Wacom Linux drivers that supports different button/pen layout profiles"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="GPL-2.0-or-later"
depends="xinput"
makedepends="
	extra-cmake-modules
	kconfig5-dev
	kcoreaddons5-dev
	kdbusaddons5-dev
	kdoctools5-dev
	kglobalaccel5-dev
	ki18n5-dev
	knotifications5-dev
	kwidgetsaddons5-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	libwacom-dev
	plasma-framework5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	xf86-input-wacom-dev
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/plasma/wacomtablet.git"
source="https://download.kde.org/stable/wacomtablet/$pkgver/wacomtablet-$pkgver.tar.xz
	0001-qt-5.15.patch
	0002-turn-off-gesture-support-by-default-and-warn-when-turning-it-on-manually.patch
	0003-Fix-build.patch
	"
subpackages="$pkgname-lang $pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure ctest -E "Test.KDED.DBusTabletService"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
acbabd6d6546bc85f0ed4e245668dc89b1c2ecaedd3754bf7ad8027b90f3ae81e5312395376de272dcbd416a9a1115bff2481351bd3f418bef7fa06d0db0c5a6  wacomtablet-3.2.0.tar.xz
120b2e3b57159d0bcfbee707d4f328c2dbeef846d449f5fde7b452da99bcd2de79463bd63e88dc26d7c9071e6fbd112dd528d5c05817bc16c16276004ab4b78f  0001-qt-5.15.patch
b17bb7afcea1eeda529ec0a5bdc90d134eae7b39529fe369b0b1e16b5a9354b41c7affa89d8b2ac58e48c8b3d044cb09025da85644ca7ac472d749f1fefbb067  0002-turn-off-gesture-support-by-default-and-warn-when-turning-it-on-manually.patch
6f530677ba35c98df33f284d8d3f6f2c9273bc7da2d46fbb4665200851ed19018bd52d727cf74b0f06c41295f0f0e1fd90acc0d66ca28481fb90a4153b05d779  0003-Fix-build.patch
"
